<?php class HeatherBlockCode extends HeatherBlock {
	protected $_Identity = 'Code';
	protected $_Header = '';
	protected function CleanLastIfEmpty () {
		$Result = TRUE;
		$Last = array_pop ($this->Children);
		if (! $this->IsEmptyString ($Last->Data)) {
			array_push ($this->Children, $Last);
			$Result = FALSE;
		}
		return ($Result);
	}

	public function __construct ($Header = '') {
		$this->_Header = $Header;
		if ('/' === substr ($Header, 0, 1)) {
			$HeaderLine = new HeatherString ();
			$HeaderLine->Append ('#!'.$Header);
			$this->AddChild ($HeaderLine);
		}
	}
	public function CleanEmpty () {
		$this->CleanLastIfEmpty () and $this->CleanLastIfEmpty ();
	}
	protected function XMLAttributes () {
		$Result = '';
		strlen ($this->_Header) and $Result .= ' header="'.htmlspecialchars ($this->_Header, ENT_QUOTES).'"';
		return ($Result);
	}
} ?>